<template>
	<view class="">
		<block v-if="datas.length">
           <view class="artItem posRelative mb15  " v-for="(i,n) in datas" :key="n" @click="toMain(i)">
           	<view class="align-center justify-between">
           		<image src="/static/images/f.png" mode=""></image>
           		<view class="right flex1">
           			<view class="align-center justify-between ">
           				<view class="align-center">
           					<view class="name">
           						{{i.realname}}
           					</view>
           					<text class="tag">会员</text>
           				</view>
           
           				<!-- <view class="" style="color: #3d3d3d;">
           					已成功对接 <text style="color: #3662EC;font-weight: 500;"> 3 </text>次 被查看  <text style="color: #3662EC;font-weight: 500;">56</text>  次
           				</view> -->
           			</view>
           			<view class="desc">
           				{{i.company}} | {{i.career}}
           			</view>
           		</view>
           	</view>
           	<view class=" mt16 align-center justify-start flex-wrap">
           		<view class="tags">
           			{{i.classname}}
           		</view>
           	</view>
           	<view class="partnerdata  mt20 ft15 align-center">
           		<text>合作类型：</text>
           		<view class="clamp1 jointype ml15" style="">
           			{{i.requirements}}
           		</view>
           	</view>
           	<view class="partnerdata mt15 ft15 align-center">
           		<text>合作需求：</text>
           		<view class="clamp1 jointype ml15" style="">
           			{{i.smallclassname}}
           		</view>
           	</view>
           </view>
		   </block>
        <view class="" v-if="datas.length==0">
            <uv-empty ></uv-empty>
        </view>
	
	</view>
</template>

<script>
	export default {
		data() {
			return {
				datas:[],
                user_id:uni.getStorageSync('userId')

			};
		},
		onLoad(opt) {
			if(opt.type==2){
				this.getList()
			}else{
				this.getLists()
			}
            
		},
		onShow() {
		},
		methods: {
            formateTime(data){
              return this.$utils.formatDateTime(data)  
            },
			
			async getList() {
				let data = await this.$api.interfaceToMe({to_user_id:this.user_id})
				console.log(data)
                this.datas = data.data
			},
			async getLists() {
				let data = await this.$api.interfaceByMe({from_user_id:this.user_id})
				console.log(data)
			    this.datas = data.data
			},

		}
	}
</script>

<style lang="scss" scoped>
	.artItem {
	
		border-bottom: 2rpx solid #D8D8D8;
		margin-bottom: 58rpx;
		padding-bottom: 42rpx;
		font-size: 24rpx;
		color: #666666;
	
		image {
			width: 96rpx;
			height: 96rpx;
			margin-right: 30rpx;
			flex-shrink: 0;
		}
	
		.name {
			font-weight: 500;
			font-size: 30rpx;
			color: #3D3D3D;
		}
	
		.right {
			width: 422rpx;
	
			image {
				width: 28rpx;
				margin: 0 4rpx 0 0;
			}
	
			.name {
				font-weight: 700;
				font-size: 28rpx;
				color: #3D3D3D;
				margin-right: 22rpx;
			}
		}
	
		.tag {
			width: 82rpx;
			height: 40rpx;
			background: #FF0000;
			border-radius: 60rpx 60rpx 60rpx 60rpx;
			text-align: center;
			font-size: 28rpx;
			color: #fff;
			display: block;
		}
	
		.desc {
			margin-top: 10rpx;
			line-height: 32rpx;
		}
	}
	
	.mt16 {
		margin-top: 32rpx;
	}
	
	.tags {
		padding: 10rpx 20rpx;
		border-radius: 60rpx;
		font-size: 28rpx;
		background: #FFBC47;
		letter-spacing: 2rpx;
		line-height: 28rpx;
		color: #fff;
		text-align: center;
	}
	
	.partnerdata {
		color: #3D3D3D;
	
	}
	
</style>